package com.uzai.common.enums;

/**
 * 产品模块KEY
 */
public enum ProductKeyEnum {
    /**
     * 淘宝
     */
    TB("tb","淘宝"),

    /**
     * 京东
     */
    JD("jd","京东"),

    /**
     * 拼多多
     */
    PDD("pdd","拼多多"),

    /**
     * 唯品会
     */
    VPH("vph","唯品会"),

    /**
     * 本地生活
     */
    LOCAL_LIVE("local_live","本地生活"),

    /**
     * 悠聊
     */
    UZAICHAT("uzaichat","悠聊"),

    /**
     * CMS
     */
    CMS("cms","CMS"),


    /**
     * 抖音
     */
    DY("dy","抖音"),

    /**
     * 快手
     */
    KS("ks","快手"),

    /**
     * 封号转名片
     */
    BANTRANSFER("bantransfer","封号转名片"),

    /**
     * 微信公众号
     */
    WX_PUB("wx_pub","微信公众号"),

    ;

    private String value;
    private String desc;
    ProductKeyEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    public String getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public static ProductKeyEnum getValue(String value) {
        if (value == null) {
            return null;
        }
        for (ProductKeyEnum type: ProductKeyEnum.values()) {
            if (type.getValue().equals(value) ) {
                return type;
            }
        }
        return null;
    }
    public static String getDesc(String value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getDesc();
    }

}
